﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using Should;

namespace NGeo.Yahoo.PlaceFinder
{
    [TestClass]
    public class ReverseRequestTests
    {
        [TestMethod]
        public void Yahoo_PlaceFinder_ReverseRequest_ShouldSerializeGFlags()
        {
            var request = new ReverseRequest();
            request.GFlags.Add(RequestGFlag.QuickMode);
            var flags = request.GetGFlagsAsString();
            flags.ShouldEqual("QR");
        }

        [TestMethod]
        public void Yahoo_PlaceFinder_ReverseRequest_ShouldSerializeReverseQuery()
        {
            var request = new ReverseRequest
            {
                Latitude = 6.945,
                Longitude = 9.996,
            };

            var result = request.ReverseQuery;

            result.ShouldEqual(string.Format("{0} {1}", request.Latitude, request.Longitude));
        }
    
    }
}
